<!doctype html>
<html class="x-admin-sm">
<head>
	<#include "/common/headbase.html"/>
	<link rel="stylesheet" href="${base}/static/css/login.css">
</head>
<body class="login-bg">

	<div class="login layui-anim layui-anim-up">
		<div class="message">管理平台</div>
		<div id="darkbannerwrap"></div>

		<form method="post" class="layui-form">
			<input type="text" name="userName" placeholder="用户名"
				lay-verify="required" class="layui-input">
			<hr class="hr15">
			<input type="password" name="password" lay-verify="required"
				placeholder="密码" class="layui-input">
			<hr class="hr15">
			<input type="text" name="code" placeholder="谷歌验证器"
				lay-verify="required" class="layui-input">
			<hr class="hr15">
			<input value="登录" lay-submit lay-filter="login" style="width: 100%;"
				type="submit">
			<hr class="hr20">
		</form>
	</div>

	<script>
		$(function() {
			layui.use('form', function() {
				var form = layui.form;
				form.on('submit(login)', function(data) {
					success=function(result){
						layui.data("user", {
			                key: "data",
			                value: result.data
			            });
						location.href = '/main/index';
					}
					var field = data.field;
					field.password=hexMD5(field.password);
					apipost("/v1/user/loginweb",field,success);
					return false;
				});
			});
		})
	</script>
</body>
</html>